import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import tailwindConfig from './tailwind.config'
import tailwindcss from 'tailwindcss'
import path from 'path';

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src'), // 设置 '@' 别名为 src 目录
    },
  },
  css: {
    postcss: {
      plugins: [
        tailwindcss({
          config: tailwindConfig, // Tailwind CSS 配置文件路径
        }),
        {
          postcssPlugin: 'internal:charset-removal',
          AtRule: {
            charset: (atRule) => {
              if (atRule.name === 'charset') {
                atRule.remove();
              }
            }
          }
        }
      ]
    }
  }
})
